// 群消息表格
// 字段说明
// id,群id 发送者id 发送内容 内容类型（0，文字1 图片链接，3音频） 发送时间 未读



const mongoose = require('mongoose'); //导入
const Schema = mongoose.Schema(); //创建集合字段

const friendGroup = require('./friendGroup');
const user = require('./user');


let studentSchema = new Schema({
  groupId: {
    type: Schema.Schema.Types.ObjectId,
    ref: friendGroup
  },
  userId: {
    type: Schema.Schema.Types.ObjectId,
    ref: user
  },
  name: String,
  content: String,
  tiP: {
    type: Number,
    default: 0
  }, //未读数量
  time: Date,
  shield: {
    type: Number,
    default: 0
  } //(是否屏蔽 0不屏蔽，1屏蔽)



})



let student = mongoose.model('student', studentSchema)

module.exports = student; //导出学生